<div id="content">
	<% for post in @posts.sort{|x,y|
	y.create_at <=> x.create_at
	} %>
	<div class="post">
		<h2><%=h post.title%></h2>
		<span class="post_date"><%= post.create_at.strftime("%m/%d/%Y") if post.create_at != nil%></span>
		<ul class="post_menu">
			<li><%= link_to_remote 'View Full Edition',
			:loading => "new Element.hide('content')",
			:complete => "new Effect.Appear('content',{queue: 'end'})",
			:update => 'content',
			:url => { :action => 'view', :id => post } %></li>
		</ul>
		<div class="post_body">
			<% flag = (post.body =~ /\[:FLAG\]/)
			flag = 500 if flag == nil %>
			<%= post.body.slice(0,flag)%>...
		</div>
		<br />
	</div>
	<% end %>
	<%= link_to 'Previous page', { :page => @post_pages.current.previous } if @post_pages.current.previous %>
	<%= link_to 'Next page', { :page => @post_pages.current.next } if @post_pages.current.next %> 
</div>
